(function($){
    bela.prep["eventProcessor"] = function(key,value,jsonParent,jqueryParent,belaJson){
        
        if(key.charAt(0)=="~"){
           
            var e = key.match(/~[^-#]+/)[0].slice(1);
            var t = /[#.]/i.test(key) ? key.match(/[#.][^-]+/g).join("") : value["@target"];
            var f = /->[^-#]+/.test(key) ? key.match(/->[^-#]+/i)[0].slice(2) : value["@action"]; 
            
            if(typeof value === "object" && value instanceof Array){
                var params = value;
                value = {
                    "@params":params
                };
            }
            
            var p = value["@params"];

            jqueryParent.bind(e,function(event){
                if(t){
                    var j = $(t);
                    j[f].apply(j,p);
                }else{
                    window[f].apply(null,p);
                }
            });
            
            value.isProcessed = true;
        }
    }
}(jQuery));

